'''
Company: TWL
Author: xue jian
Email: xuejian@kanzhun.com
Date: 2020-11-22 11:32:17
'''
#
# @lc app=leetcode.cn id=242 lang=python3
#
# [242] 有效的字母异位词
#

# @lc code=start
class Solution:
    def isAnagram(self, s: str, t: str) -> bool:
        import collections
        stores=collections.defaultdict(lambda:0)
        storet=collections.defaultdict(lambda:0)
        for i in s:
            stores[i]+=1
        for i in t:
            storet[i]+=1
        for i, v in stores.items():
            if v!=storet[i]:
                return False
        for i, v in storet.items():
            if v!=stores[i]:
                return False
        return True
# @lc code=end

